package com.wzk.mapper;

import com.wzk.pojo.Student;
import com.wzk.pojo.StudentQueryParam;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

@Mapper
public interface StudentMapper {

    List<Student> pageQuery(StudentQueryParam studentQueryParam);

    void deleteByIds(List<Integer> ids);

    void addStudent(Student student);
    @Select("select id, name, no, gender, phone, id_card, is_college, address, degree, graduation_date, clazz_id, violation_count, violation_score, create_time, update_time from student where id=#{id}")
    Student getInfo(Integer id);
    @Update("update student set violation_count=#{violationCount},violation_score=#{violationScore} where id=#{id}")
    void updateViolation(Integer id, int violationCount, int violationScore);

    List<Map<String, Object>> getStudentDegreeData();

    List<Map<String, Object>> getClazzData();
}
